Object documentationBilling Document from Data Transfer

 

A billing document created by the data transfer process contains the information that invoicing needs in order to bill for services performed for a customer. The system saves this external document data in the form of billing documents.

 

As a result of saving the external document data in billing documents:

  • The timing of invoicing is separate from the transfer of the external document data.

  • If there are several billing documents for a contract account, invoicing can group these into one invoicing document and therefore one invoice. The source of the billing documents is not important for this grouping. That means that the documents can come from different external systems.

  • A connection is created to the documents of the external system. The billing documents contain a unique reference to the external document from which they arose.

Structure

When a billing document is created, the system simultaneously creates an invoicing order.

Invoicing orders enable the invoicing program to quickly select specific billing documents that have not been processed yet. If the invoicing of a billing document is successful, the related invoicing order is deleted.

Billing documents cannot be deleted. If the content of a billing document is not correct, it can only be reversed. For a reversal, the system creates a reversal billing document. The reversal document suppresses the invoicing of the billing document that is reversed. If the billing document has already been invoiced, the reversal document ensures that the amounts and quantities are posted again but with the opposite +/- sign.

You can designate billing documents as simulation documents, which you can then use for checking and testing. The system does not create invoicing orders and postings for simulation documents.

The system saves the key of the external document from which the billing document arose with the billing document. This means that, from the invoicing document, you can navigate to the external document(s) via the billing document(s). When billing documents are created, the system checks whether the key of the external system and the key of the logical system from which the external document is transferred are unique or already assigned. This also applies for simulation documents and reversal documents.

Billing documents consist of:

The header of a billing document contains:

  • The reference to the external document from which it arose

  • The key of the contract account and business partner

Each billing document contains one or more billing document items. They contain:

  • Amounts and quantities

  • Information that influences the account determination and the tax determination in invoicing

  • Information for invoice printing and the statistical treatment of the amounts and quantities

The billing document tax items are optional. They are filled if the tax calculation took place in the external system. If invoicing calculates the taxes, the system does not create billing document tax items.

The billing document additional items are also optional. The SAP standard delivery contains only a few fields. Billing document additional items are suitable for printing additional information on an invoice, for example, call itemization on a telephone bill. If you want to use billing document additional items, you have to add the fields that you require to the structure. You can also use the billing document additional items as a pure link table. To do this, save additional document data in one or more of your own tables, for example. The table of billing document additional items is only used to link the entries from these customer-defined tables with billing document headers or billing document items.

Invoicing does not use the billing document additional items operatively.

For billing documents, there are three different layers in relation to the ABAP Dictionary (DDIC):

  • Database layer

  • Logical layer

  • Display layer

In the database layer, the system stores the billing documents in four different transparent tables. The database tables are only used for the update or in access modules. In the application programs (inbound interface, BAdIs), the billing documents are managed in logical tables. There are additional display structures for the display.

The following table provides an overview of the DDIC structures of the individual layers for the individual components of the billing document:

Component

Database Layer

Logical Layer

Display Layer

Header

DFKKINVBILL_H

FKKINVBILL_H

FKKINVBILL_H_DISP

Items

DFKKINVBILL_I

FKKINVBILL_I

FKKINVBILL_I_DISP

Tax Items

DFKKINVBILL_T

FKKINVBILL_T

FKKINVBILL_T_DISP

Additional Items

DFKKINVBILL_A

FKKINVBILL_A

FKKINVBILL_A_DISP

You can use the method SELECT of class CL_FKKINV_BILL_DOC to read billing documents from the database. The method reads the billing documents from the database and converts them into the structures of the logical layer.

The structures of the display layer are almost identical to those of the logical layer. They contain an additional customer include that you can use to add additional fields for the display.

Note Note

You can add additional display fields to the display structure of the billing document items FKKINVBILL_I_DISP using the include CI_FKKINVBILL_I_DISP. This enhancement does not affect the database layer or the logical layer. You must fill the fields of the customer include in an implementation of event 2678.

End of the note.